home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FLI106C.ZIP;1 / WINSET.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  1.1 KB  |  54 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // MenuControl --> MenuItems --> FusionWindow
  8. //
  9.  
  10. #include "fliwin.h"
  11. #include "colors.h"
  12.  
  13. #ifdef __BCPLUSPLUS__
  14. #pragma hdrstop
  15. #endif
  16.  
  17. #include <string.h>
  18.  
  19. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  20. //
  21. // SetMenuBar()
  22. //
  23. // Anchors the menu bar
  24. //
  25. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  26.  
  27. int MenuManager::SetMenuBar(int X,int Y,int Width,void far *Memory)
  28. {
  29.   BlazeClass Blaze;
  30.  
  31.   if (Memory)
  32.     Blaze.UseMemory(Memory);
  33.  
  34.   SetX=X;
  35.   SetY=Y;
  36.   StowedWidth=Width;
  37.  
  38.   Blaze.CharacterRepeater(X,Y,Width,Colors.MenuBarNormal,' ');
  39.  
  40.   for (int i=0,j=1;i<NumberOfMenus;i++)
  41.   {
  42.     Blaze.QuickDisplay(X+j,Y,Colors.MenuBarBold,Colors.MenuBarNormal,
  43.       Menus[i]->Title);
  44.     Menus[i]->XStart=X+j-1;
  45.     j+=(strlen(Menus[i]->Title)+1);
  46.     if (!strchr(Menus[i]->Title,'~'))
  47.       j++;
  48.     Menus[i]->XEnd=X+j-2;
  49.   }
  50.  
  51.   return (X+j+1)-X;
  52. }
  53.  
  54.